﻿using BCCommon;
using BCDto.WeChatComponent.WeChatMessagePushRecord;
using BCDto.WeChatComponent.WeChatPushMessage;
using System;
using System.Collections.Generic;
using System.Text;
using WeChatSDK.Common.Enums.MP;
using WeChatSDK.WeChatDto.MP;

namespace BCService.WeChatComponent.WeChatMessagePushService
{
    /// <summary>
    /// 微信群发服务接口
    /// </summary>
    public interface IWeChatMessagePushService
    {
        /// <summary>
        /// 预览群发
        /// openId和用户名可同时存在，
        /// 同时存在已用户名有先发送
        /// </summary>
        /// <param name="mediaId">素材Id</param>
        /// <param name="openId">微信OpenId</param>
        /// <param name="wechatName">微信用户名</param>
        /// <param name="content">文本群发预览时必须填写</param>
        /// <returns></returns>
        string PreviewPushMessage(string mediaId,string openId, string wechatName, string content);

        /// <summary>
        /// 发送微信群发消息
        /// </summary>
        /// <param name="weChatPushMessageRequestDto">群发信息设置</param>
        /// <returns></returns>
        void PushMessage(WeChatPushMessageRequestDto weChatPushMessageRequestDto);
        /// <summary>
        /// 删除微信群发消息
        /// </summary>
        /// <param name="weChatPushMessageDeleteDto">删除微信群发消息</param>
        void DeletePushMessage(WeChatPushMessageDeleteDto weChatPushMessageDeleteDto);
        /// <summary>
        /// 获取微信群发记录（分页）
        /// </summary>
        /// <param name="mediaId">素材Id</param>
        /// <param name="msgStatus">消息状态</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="ascending">排序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <returns></returns>
        PageableList<WeChatMessagePushRecordDto> Query(string mediaId, string msgStatus, DateTime? start, DateTime? end, bool? ascending, int pageIndex = 1, int pageSize = 10);
        /// <summary>
        /// 更新已推送文章评论开关
        /// </summary>
        /// <param name="mediaId">素材Id</param>
        /// <param name="messageDataId">推送后的消息数据Id</param>
        /// <param name="index">要更新的文章索引</param>
        /// <param name="openComment">打开或关闭评论</param>
        /// <returns></returns>
        void UpdateAlreadyPushArticleComment(string mediaId, int messageDataId,int index,bool openComment);
    }
}
